package com.demo.printApple;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Util {
    private Util() {}

    public static List<Apple> getApples() {
        String[] colors = {"red", "green", "yellow"};
        Random random = new Random();
        List<Apple> inventory = new ArrayList<>();
        Apple apple = null;
        for(int i = 0; i < 20; i++) {
            apple = new Apple();
            apple.setColor(colors[random.nextInt(3)]);
            apple.setWeight(random.nextInt(400));
            inventory.add(apple);
        }
        return inventory;
    }
}
